// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/*!
 * @file airspeed.cpp
 * This source file contains the definition of the described types in the IDL file.
 *
 * This file was generated by the tool gen.
 */

#ifdef _WIN32
// Remove linker warning LNK4221 on Visual Studio
namespace { char dummy; }
#endif

#include "airspeed.h"
#include <fastcdr/Cdr.h>

#include <fastcdr/exceptions/BadParamException.h>
using namespace eprosima::fastcdr::exception;

#include <utility>

airspeed::airspeed()
{
    // m_timestamp_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@4f970963
    m_timestamp_ = 0;
    // m_indicated_airspeed_m_s_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@61f8bee4
    m_indicated_airspeed_m_s_ = 0.0;
    // m_true_airspeed_m_s_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7b49cea0
    m_true_airspeed_m_s_ = 0.0;
    // m_air_temperature_celsius_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@887af79
    m_air_temperature_celsius_ = 0.0;
    // m_confidence_ com.eprosima.idl.parser.typecode.PrimitiveTypeCode@7fac631b
    m_confidence_ = 0.0;

}

airspeed::~airspeed()
{





}

airspeed::airspeed(const airspeed &x)
{
    m_timestamp_ = x.m_timestamp_;
    m_indicated_airspeed_m_s_ = x.m_indicated_airspeed_m_s_;
    m_true_airspeed_m_s_ = x.m_true_airspeed_m_s_;
    m_air_temperature_celsius_ = x.m_air_temperature_celsius_;
    m_confidence_ = x.m_confidence_;
}

airspeed::airspeed(airspeed &&x)
{
    m_timestamp_ = x.m_timestamp_;
    m_indicated_airspeed_m_s_ = x.m_indicated_airspeed_m_s_;
    m_true_airspeed_m_s_ = x.m_true_airspeed_m_s_;
    m_air_temperature_celsius_ = x.m_air_temperature_celsius_;
    m_confidence_ = x.m_confidence_;
}

airspeed& airspeed::operator=(const airspeed &x)
{

    m_timestamp_ = x.m_timestamp_;
    m_indicated_airspeed_m_s_ = x.m_indicated_airspeed_m_s_;
    m_true_airspeed_m_s_ = x.m_true_airspeed_m_s_;
    m_air_temperature_celsius_ = x.m_air_temperature_celsius_;
    m_confidence_ = x.m_confidence_;

    return *this;
}

airspeed& airspeed::operator=(airspeed &&x)
{

    m_timestamp_ = x.m_timestamp_;
    m_indicated_airspeed_m_s_ = x.m_indicated_airspeed_m_s_;
    m_true_airspeed_m_s_ = x.m_true_airspeed_m_s_;
    m_air_temperature_celsius_ = x.m_air_temperature_celsius_;
    m_confidence_ = x.m_confidence_;

    return *this;
}

size_t airspeed::getMaxCdrSerializedSize(size_t current_alignment)
{
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

size_t airspeed::getCdrSerializedSize(const airspeed& data, size_t current_alignment)
{
    (void)data;
    size_t initial_alignment = current_alignment;


    current_alignment += 8 + eprosima::fastcdr::Cdr::alignment(current_alignment, 8);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);


    current_alignment += 4 + eprosima::fastcdr::Cdr::alignment(current_alignment, 4);



    return current_alignment - initial_alignment;
}

void airspeed::serialize(eprosima::fastcdr::Cdr &scdr) const
{

    scdr << m_timestamp_;
    scdr << m_indicated_airspeed_m_s_;
    scdr << m_true_airspeed_m_s_;
    scdr << m_air_temperature_celsius_;
    scdr << m_confidence_;
}

void airspeed::deserialize(eprosima::fastcdr::Cdr &dcdr)
{

    dcdr >> m_timestamp_;
    dcdr >> m_indicated_airspeed_m_s_;
    dcdr >> m_true_airspeed_m_s_;
    dcdr >> m_air_temperature_celsius_;
    dcdr >> m_confidence_;
}

/*!
 * @brief This function sets a value in member timestamp_
 * @param _timestamp_ New value for member timestamp_
 */
void airspeed::timestamp_(uint64_t _timestamp_)
{
m_timestamp_ = _timestamp_;
}

/*!
 * @brief This function returns the value of member timestamp_
 * @return Value of member timestamp_
 */
uint64_t airspeed::timestamp_() const
{
    return m_timestamp_;
}

/*!
 * @brief This function returns a reference to member timestamp_
 * @return Reference to member timestamp_
 */
uint64_t& airspeed::timestamp_()
{
    return m_timestamp_;
}

/*!
 * @brief This function sets a value in member indicated_airspeed_m_s_
 * @param _indicated_airspeed_m_s_ New value for member indicated_airspeed_m_s_
 */
void airspeed::indicated_airspeed_m_s_(float _indicated_airspeed_m_s_)
{
m_indicated_airspeed_m_s_ = _indicated_airspeed_m_s_;
}

/*!
 * @brief This function returns the value of member indicated_airspeed_m_s_
 * @return Value of member indicated_airspeed_m_s_
 */
float airspeed::indicated_airspeed_m_s_() const
{
    return m_indicated_airspeed_m_s_;
}

/*!
 * @brief This function returns a reference to member indicated_airspeed_m_s_
 * @return Reference to member indicated_airspeed_m_s_
 */
float& airspeed::indicated_airspeed_m_s_()
{
    return m_indicated_airspeed_m_s_;
}

/*!
 * @brief This function sets a value in member true_airspeed_m_s_
 * @param _true_airspeed_m_s_ New value for member true_airspeed_m_s_
 */
void airspeed::true_airspeed_m_s_(float _true_airspeed_m_s_)
{
m_true_airspeed_m_s_ = _true_airspeed_m_s_;
}

/*!
 * @brief This function returns the value of member true_airspeed_m_s_
 * @return Value of member true_airspeed_m_s_
 */
float airspeed::true_airspeed_m_s_() const
{
    return m_true_airspeed_m_s_;
}

/*!
 * @brief This function returns a reference to member true_airspeed_m_s_
 * @return Reference to member true_airspeed_m_s_
 */
float& airspeed::true_airspeed_m_s_()
{
    return m_true_airspeed_m_s_;
}

/*!
 * @brief This function sets a value in member air_temperature_celsius_
 * @param _air_temperature_celsius_ New value for member air_temperature_celsius_
 */
void airspeed::air_temperature_celsius_(float _air_temperature_celsius_)
{
m_air_temperature_celsius_ = _air_temperature_celsius_;
}

/*!
 * @brief This function returns the value of member air_temperature_celsius_
 * @return Value of member air_temperature_celsius_
 */
float airspeed::air_temperature_celsius_() const
{
    return m_air_temperature_celsius_;
}

/*!
 * @brief This function returns a reference to member air_temperature_celsius_
 * @return Reference to member air_temperature_celsius_
 */
float& airspeed::air_temperature_celsius_()
{
    return m_air_temperature_celsius_;
}

/*!
 * @brief This function sets a value in member confidence_
 * @param _confidence_ New value for member confidence_
 */
void airspeed::confidence_(float _confidence_)
{
m_confidence_ = _confidence_;
}

/*!
 * @brief This function returns the value of member confidence_
 * @return Value of member confidence_
 */
float airspeed::confidence_() const
{
    return m_confidence_;
}

/*!
 * @brief This function returns a reference to member confidence_
 * @return Reference to member confidence_
 */
float& airspeed::confidence_()
{
    return m_confidence_;
}


size_t airspeed::getKeyMaxCdrSerializedSize(size_t current_alignment)
{
    size_t current_align = current_alignment;








    return current_align;
}

bool airspeed::isKeyDefined()
{
   return false;
}

void airspeed::serializeKey(eprosima::fastcdr::Cdr &scdr) const
{
    (void) scdr;
     
     
     
     
     
}
